﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PQ.Model;
using PQ.IDA;
using PQ.DA;
using System.IO;

namespace PQ.BL
{
    public class BLUser:IBL.IBLUser
    {

        private IDAUser daUser;

        public BLUser()
        {
            daUser = new DAUser();
        }

        public UserEntity Login(UserEntity userEntity)
        {
            try
            {
                return daUser.Login(userEntity);
            }
            catch (Exception)
            {
                throw;
            }
            
        }


        public bool IsNeedVerifyCode(UserEntity userEntity)
        {
          return  daUser.IsNeedVerifyCode(userEntity);
        }


        public Stream GetVerifyCodePicStream(UserEntity userEntity)
        {
            return daUser.GetVerifyCodePicStream(userEntity);
        }


        public void LogOut(UserEntity userEntity)
        {
            daUser.LogOut(userEntity);
        }


        public UserEntity GetUserFriends(UserEntity userEntity)
        {
           return daUser.GetUserFriends(userEntity);
        }


        public Stream GetUserAvatar(string uin)
        {
            return daUser.GetUserAvatar(uin);
        }


        public List<MessageModel> GetMessage(UserEntity userEntity)
        {
           return  daUser.GetMessage(userEntity);
        }


        public bool SendFriendMessage(MessageModel messageModel, UserEntity userEntity)
        {
            return daUser.SendFriendMessage(messageModel, userEntity);
        }


        public List<UserEntity> GetUsers()
        {
            return daUser.GetUsers();
        }
    }
}
